<?php
namespace App\Socket\Logic;
class Card{
    private $CName=["Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King","One","Two","SJoker","LJoker"];
    private $CColor = ["Spade","Heart","Club","Square"];

    public $name;
    public $color;    
    public $title;
    public function __construct($name,$color=null){
        $this->name=$name;
        $this->color=$color; 
        $this->title = $color?$color.$name:$name;
    }

    public function getValue(){
        return array_search($this->name,$this->CName);
    }
    
}